<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>提现详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <style type="text/css">
        .width{
            width: 200px;
        }
    </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>提现详情</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">用户名：</label>
                            <label class="col-sm-3 control-label">{$data.user_name}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">mt4账号：</label>
                            <label class="col-sm-3 control-label">{$data.mt4}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">持卡人姓名：</label>
                            <label class="col-sm-3 control-label">{$data.bank_username}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">银行所在地：</label>
                            <label class="col-sm-3 control-label">{$data.area_1}-{$data.area_2}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">银行名称：</label>
                            <label class="col-sm-3 control-label">{$data.bank}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">银行账号：</label>
                            <label class="col-sm-3 control-label">{$data.bank_number}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">支行名称：</label>
                            <label class="col-sm-3 control-label">{$data.bank_name}</label>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label width">提现数额：</label>
                            <label class="col-sm-3 control-label">$ {$data.usd}</label>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label width">金额(￥)：</label>
                            <label class="col-sm-3 control-label">{$data.rmb}</label>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label width">手续费：</label>
                            <label class="col-sm-3 control-label">{$data.fee}</label>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label width">状态：</label>
                            <label class="col-sm-3 control-label">{$data.state}</label>
                        </div>
                        <if condition="$data.status eq 4">
                            <div class="form-group">
                                <label class="col-sm-3 control-label width">拒绝理由：</label>
                                <label class="col-sm-3 control-label">{$data.reason}</label>
                            </div>
                        </if>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-8">
                                <if condition="($data.status eq 1) or ($data.status eq 2)">
                                    <button class="btn btn-sm btn-info" type="button" onclick="examine_agree(this,'{$data.mt4}');">审核为已受理</button>
                                    <!--<button style="margin-left: 100px;" class="btn btn-sm btn-info" type="submit" onclick="drawing_refuse(this,'{$data.mt4}');">-->
                                        <a style="margin-left: 80px;" data-toggle="modal" class="btn btn-primary" href="drawing_OneData.html#modal-form">拒绝申请</a>
                                        <!--拒绝申请</button>-->
                                </if>
                                <button style="margin-left: 80px;" class="btn btn-sm btn-info" type="submit" onclick="layer_close();">返回</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--弹出层》-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-6 b-r">
                        <h3 class="m-t-none m-b">填写拒绝理由</h3>
                        <form role="form">
                            <div class="form-group">
                                <label>拒绝理由：</label>
                                <textarea type="email_content" id="email_content" style="height: 150px;" class="form-control"></textarea>
                            </div>

                            <div>
                                <button class="btn btn-sm btn-primary pull-right m-t-n-xs" type="button" onclick="drawing_refuse(this,'{$data.mt4}');"><strong>确认</strong>
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<script src="__PUBLIC__/common/js/layer_show.js"></script>

<script>
   function examine_agree(obj,mt4) {
     var id = '{$data.id}';
       layer.confirm('审核需谨慎，确认审核为已受理吗？', function () {
           var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
           $.ajax({
               type:"POST",
               url:"__MODULE__/Apply/drawing_status",
               dataType:'json',
               data:{mt4:mt4,id:id},
               success:function(data){
                   //console.log(data);
                   //alert(JSON.stringify(data));return;
                   layer.close(index);
                   if(data.status==1){
                       layer.msg(data.msg);
                       setTimeout(function () {location.reload();}, 1000);
                   }else if(data.status==0){
                       layer.msg(data.msg,{icon: 2, time: 2000});
                   }else{
                       layer.msg('网络错误',{icon: 2, time: 2000});
                   }
               },error:function(err){
                   //console.log(err);
                   layer.close(index);
                   layer.msg('网络错误',{icon: 2, time: 2000});
               }
           });
       })
   }

   function drawing_refuse(obj,mt4) {
        var content = $("#email_content").val();
        var id = '{$data.id}';
        if(content==''){
            layer.msg("邮件内容不能为空");
        }else if(id=='' || mt4==''){
            layer.msg("信息获取失败，请刷新重试");
        }else{
            var index = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            $.ajax({
                type:"POST",
                url:"__MODULE__/Apply/drawing_refuse",
                dataType:'json',
                data:{content:content,mt4:mt4,id:id},
                success:function(data){
                    //console.log(data);
                    //alert(JSON.stringify(data));return;
                    layer.close(index);
                    if(data.status==1){
                        layer.msg(data.msg);
                        setTimeout(function () {location.reload();}, 1000);
                    }else if(data.status==0){
                        layer.msg(data.msg,{icon: 2, time: 2000});
                    }else{
                        layer.msg('网络错误',{icon: 2, time: 2000});
                    }
                },error:function(err){
                    //console.log(err);
                    layer.close(index);
                    layer.msg('网络错误',{icon: 2, time: 2000});
                }
            });
        }


   }






</script>




</body>

</html>
